<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>提现订单查询</title>
	<%@ include file="/view/common/tags.jsp"%>
	<script type="text/javascript" src="${sysManagerV1}/js/My97DatePicker/WdatePicker.js"> </script>
    <style type="text/css">
        #finDrawClDiv label{line-height: 25px;}
        #finDrawClDiv span{line-height: 25px;}
        #finDrawClDiv2{padding: 12px;}
    </style>
</head>
<body>
	<section class="content">
    	<div class="row">
            <div class="col-md-12">
                <div class="box">
                	<div class="box-body">
						<div class="panel panel-default">
                            <div class="panel-body" style="padding-bottom:5px;">
                                <form class="form-horizontal" action="" method="post" id="dataForm">
                                    <input type="hidden" id="token" name="token" value="" />
                                	<div class="searchMenu">
                                	    <div>
                                            <label>提现方式：</label>
                                            <sk:select cssClass="form-control select" id="moneyWaySmall" name="wm[MONEY_WAY_SMALL_ID]" value="${page.wm.MONEY_WAY_SMALL_ID}" requiredInit="true" ajaxURL="${fundCenterV1}/fundFinanceDrawWayConfig/select?wm[DRAW_FLAG]=1">
                                                <option value="">请选择</option>
                                            </sk:select>
                                        </div>
                                	    <div>
                                            <label>订单状态：</label>
                                            <sk:select cssClass="form-control select" id="orderStat" name="wm[ORDER_STAT]" value="${page.wm.ORDER_STAT}" requiredInit="true" ajaxURL="${fundCenterV1}/fundFinanceDrawDetail/finDrawStateDictList">
                                                <option value="">请选择</option>
                                            </sk:select>
                                        </div>
                                        <div>
                                		    <label>订单编号：</label>
                                            <input type="text" class="form-control" name="wm[ORDER_NO]" value="${page.wm.ORDER_NO}" placeholder="请输入订单编号">
                                        </div>
                                        <div>
                                		    <label>用户帐号：</label>
                                            <input type="text" class="form-control" name="wm[_LIKE$USER_NAME]" value="${page.wm._LIKE$USER_NAME}" placeholder="请输入用户帐号">
                                        </div>
                                        <div>
                                            <label>提现时间：</label>
                                            <input id="createTimeStart" name="wm[_MORE_EQUAL$CREATE_TIME]" value="${page.wm._MORE_EQUAL$CREATE_TIME}"  type="text"  class="Wdate" 
											  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',startDate:'%y-%M-%d 00:00:00',alwaysUseStartDate:true,maxDate:'#F{$dp.$D(\'createTimeEnd\')}',minDate:'#F{$dp.$D(\'createTimeEnd\',{d:-30,H:-23,m:-59,s:-59})}'})" /> 
											  <span class="pull-left">&nbsp;-&nbsp;</span>
											  <input id="createTimeEnd" name="wm[_LESS_EQUAL$CREATE_TIME]" value="${page.wm._LESS_EQUAL$CREATE_TIME}"  class="Wdate" 
								               onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',startDate:'%y-%M-%d 23:59:59',alwaysUseStartDate:true,minDate:'#F{$dp.$D(\'createTimeStart\')}',maxDate:'#F{$dp.$D(\'createTimeStart\',{d:+30,H:+23,m:+59,s:+59})}'})" />
                                        </div>
                                        <div class="mal10" >
                                            <button type="button"  class="btn btn-primary btn-sm"  onclick="findData()"><span class='glyphicon glyphicon-search'></span>查&nbsp;询</button>
                                            <!-- <button type="button"  class="btn btn-primary btn-sm"  onclick="addOrder()"><span class='glyphicon glyphicon-plus'></span>录&nbsp;单</button> -->
                                        </div>
                                	</div>
                                </form>
                        	</div>
						</div>
                        <table class="table table-hover table-condensed table-bordered table-striped" id="dataTable" >
                            <thead>
                            	<tr>
                                	<th data-field="index" data-align="center" data-formatter="indexFormatter" data-sortable="false" style="width:100px;">序号</th>
                                	<th data-field="orderNo" data-align="center" data-sortable="true">订单编号</th>
                                	<th data-field="moneyWaySmallId" data-align="center" data-sortable="false" data-formatter="drawFsFormatter">提现方式</th>
                                	<th data-field="userName" data-align="center" data-sortable="false">用户帐号</th>
                                    <th data-field="txName" data-align="center" data-sortable="false">姓名</th>
                                    <th data-field="bankAccount" data-align="center" data-sortable="true">提现帐号</th>
									<th data-field="drawMoney" data-align="center" data-sortable="true">提现金额</th>
									<th data-field="fee" data-align="center" data-sortable="true">手续费</th>
									<th data-field="realGet" data-align="center" data-sortable="true">实得金额</th>
                                    <th data-field="orderStat" data-align="center" data-sortable="true" data-formatter="orderStateFormatter">订单状态</th>
                                	<th data-field="createTime" data-align="center" data-sortable="true">下单时间</th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
       	</div>
	</section>
   <%@ include file="/view/common/footer.jsp"%>
</body>
<script>
// 提示信息
var msgg='<%=request.getAttribute("msg")%>';
if (msgg && msgg!=null && msgg!='null') { 
	  layer.msg(msgg);
}
var tableIndex = 0; // 添加修改的弹出框的ID
var finDrawStateDictList = "" // 订单状态字典数据
var finDrawWayDictList = "" // 提现方式字典数据

$(function(){
    $("#token").val(sessionStorage.getItem("token"));
    $("#token2").val(sessionStorage.getItem("token"));
    
    // 提现方式字典数据
    $.ajax({
    	type: "post",
    	url: "${fundCenterV1}/fundFinanceDrawWayConfig/select?token=" + sessionStorage.getItem("token"),
    	dataType: "json",
    	success: function(data){
    		finDrawWayDictList = data;
    	}
    });
    
    // 获取订单状态信息
    $.ajax({
    	type: "post",
    	url: "${fundCenterV1}/fundFinanceDrawDetail/finDrawStateDictList",
    	dataType: "json",
    	success: function(data){
    		finDrawStateDictList = data;
    	}
    });
    
    // 加载table 数据
    $("#dataTable").bootstrapTable({ 
        url: "${fundCenterV1}/fundFinanceDrawDetail/data.json",
        method:"get", 
        contentType: "application/x-www-form-urlencoded",
        pagination:true,
        sidePagination:"server",
        queryParams: function(params) {
            //alert(JSON.stringify(params));
            return $.extend({}, params, parseJson(decodeURIComponent($("#dataForm").serialize())));     
        }
    });
})

// 提现方式 字段格式化
function drawFsFormatter(value, row, index) {
    var finDrawWay = "";
    for(var i in finDrawWayDictList){
    	if(finDrawWayDictList[i]["value"] == value){
    		finDrawWay = finDrawWayDictList[i]["label"];
    	}
    }
    return finDrawWay;
}

// 订单状态 字段格式化
function orderStateFormatter(value, row, index) {
    var orderState = "";
    for(var i in finDrawStateDictList){
    	if(finDrawStateDictList[i]["value"] == value){
    		orderState = finDrawStateDictList[i]["label"];
    	}
    }
    return orderState;
}
    
// 查询
function findData(){
   $("#dataTable").bootstrapTable("refresh",{} ); 
} 

// 行点击事件
$(function(){
     $("body").on("click","table>tbody>tr",function(){
      $(this).css("background","#e1ecf1").siblings().css("background","");
   });
})
</script>
</html>